3.892 \(\int \frac{x^2 (d+e x)}{(a+b x+c x^2)^2} \, dx\)

Optimal. Leaf size=132 \[ \frac{\left (2 a c (2 c d-3 b e)+b^3 e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \left (b^2-4 a c\right )^{3/2}}+\frac{x \left (x \left (2 a c e+b^2 (-e)+b c d\right )+a (2 c d-b e)\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{e \log \left (a+b x+c x^2\right )}{2 c^2} \]

[Out]

(x*(a*(2*c*d - b*e) + (b*c*d - b^2*e + 2*a*c*e)*x))/(c*(b^2 - 4*a*c)*(a + b*x + c*x^2)) + ((b^3*e + 2*a*c*(2*c
*d - 3*b*e))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^2*(b^2 - 4*a*c)^(3/2)) + (e*Log[a + b*x + c*x^2])/(2*c
^2)

________________________________________________________________________________________

Rubi [A]  time = 0.10541, antiderivative size = 132, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238, Rules used = {818, 634, 618, 206, 628} \[ \frac{\left (2 a c (2 c d-3 b e)+b^3 e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \left (b^2-4 a c\right )^{3/2}}+\frac{x \left (x \left (2 a c e+b^2 (-e)+b c d\right )+a (2 c d-b e)\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{e \log \left (a+b x+c x^2\right )}{2 c^2} \]

Antiderivative was successfully verified.

[In]

Int[(x^2*(d + e*x))/(a + b*x + c*x^2)^2,x]

[Out]

(x*(a*(2*c*d - b*e) + (b*c*d - b^2*e + 2*a*c*e)*x))/(c*(b^2 - 4*a*c)*(a + b*x + c*x^2)) + ((b^3*e + 2*a*c*(2*c
*d - 3*b*e))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^2*(b^2 - 4*a*c)^(3/2)) + (e*Log[a + b*x + c*x^2])/(2*c
^2)

Rule 818

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> -Si
mp[((d + e*x)^(m - 1)*(a + b*x + c*x^2)^(p + 1)*(2*a*c*(e*f + d*g) - b*(c*d*f + a*e*g) - (2*c^2*d*f + b^2*e*g
- c*(b*e*f + b*d*g + 2*a*e*g))*x))/(c*(p + 1)*(b^2 - 4*a*c)), x] - Dist[1/(c*(p + 1)*(b^2 - 4*a*c)), Int[(d +
e*x)^(m - 2)*(a + b*x + c*x^2)^(p + 1)*Simp[2*c^2*d^2*f*(2*p + 3) + b*e*g*(a*e*(m - 1) + b*d*(p + 2)) - c*(2*a
*e*(e*f*(m - 1) + d*g*m) + b*d*(d*g*(2*p + 3) - e*f*(m - 2*p - 4))) + e*(b^2*e*g*(m + p + 1) + 2*c^2*d*f*(m +
2*p + 2) - c*(2*a*e*g*m + b*(e*f + d*g)*(m + 2*p + 2)))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && Ne
Q[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 1] && ((EqQ[m, 2] && EqQ[p, -3] &&
RationalQ[a, b, c, d, e, f, g]) ||  !ILtQ[m + 2*p + 3, 0])

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{x^2 (d+e x)}{\left (a+b x+c x^2\right )^2} \, dx &=\frac{x \left (a (2 c d-b e)+\left (b c d-b^2 e+2 a c e\right ) x\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{\int \frac{-a (2 c d-b e)+\left (b^2-4 a c\right ) e x}{a+b x+c x^2} \, dx}{c \left (b^2-4 a c\right )}\\ &=\frac{x \left (a (2 c d-b e)+\left (b c d-b^2 e+2 a c e\right ) x\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{e \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c^2}-\frac{\left (b^3 e+2 a c (2 c d-3 b e)\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c^2 \left (b^2-4 a c\right )}\\ &=\frac{x \left (a (2 c d-b e)+\left (b c d-b^2 e+2 a c e\right ) x\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{e \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{\left (b^3 e+2 a c (2 c d-3 b e)\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^2 \left (b^2-4 a c\right )}\\ &=\frac{x \left (a (2 c d-b e)+\left (b c d-b^2 e+2 a c e\right ) x\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{\left (b^3 e+2 a c (2 c d-3 b e)\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \left (b^2-4 a c\right )^{3/2}}+\frac{e \log \left (a+b x+c x^2\right )}{2 c^2}\\ \end{align*}

Mathematica [A]  time = 0.217573, size = 146, normalized size = 1.11 \[ \frac{-\frac{2 \left (2 a^2 c e+a \left (b^2 (-e)+b c (d+3 e x)-2 c^2 d x\right )+b^2 x (c d-b e)\right )}{\left (b^2-4 a c\right ) (a+x (b+c x))}+\frac{2 \left (2 a c (2 c d-3 b e)+b^3 e\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\left (4 a c-b^2\right )^{3/2}}+e \log (a+x (b+c x))}{2 c^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(x^2*(d + e*x))/(a + b*x + c*x^2)^2,x]

[Out]

((-2*(2*a^2*c*e + b^2*(c*d - b*e)*x + a*(-(b^2*e) - 2*c^2*d*x + b*c*(d + 3*e*x))))/((b^2 - 4*a*c)*(a + x*(b +
c*x))) + (2*(b^3*e + 2*a*c*(2*c*d - 3*b*e))*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/(-b^2 + 4*a*c)^(3/2) + e*L
og[a + x*(b + c*x)])/(2*c^2)

________________________________________________________________________________________

Maple [B]  time = 0.01, size = 270, normalized size = 2.1 \begin{align*}{\frac{1}{c{x}^{2}+bx+a} \left ({\frac{ \left ( 3\,abce-2\,a{c}^{2}d-{b}^{3}e+{b}^{2}cd \right ) x}{{c}^{2} \left ( 4\,ac-{b}^{2} \right ) }}+{\frac{a \left ( 2\,ace-{b}^{2}e+bcd \right ) }{{c}^{2} \left ( 4\,ac-{b}^{2} \right ) }} \right ) }+2\,{\frac{\ln \left ( c{x}^{2}+bx+a \right ) ae}{ \left ( 4\,ac-{b}^{2} \right ) c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ){b}^{2}e}{ \left ( 8\,ac-2\,{b}^{2} \right ){c}^{2}}}-6\,{\frac{abe}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}c}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+4\,{\frac{ad}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{{b}^{3}e}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ) \left ( 4\,ac-{b}^{2} \right ) ^{-{\frac{3}{2}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(e*x+d)/(c*x^2+b*x+a)^2,x)

[Out]

(1/c^2*(3*a*b*c*e-2*a*c^2*d-b^3*e+b^2*c*d)/(4*a*c-b^2)*x+a*(2*a*c*e-b^2*e+b*c*d)/c^2/(4*a*c-b^2))/(c*x^2+b*x+a
)+2/(4*a*c-b^2)/c*ln(c*x^2+b*x+a)*a*e-1/2/(4*a*c-b^2)/c^2*ln(c*x^2+b*x+a)*b^2*e-6/(4*a*c-b^2)^(3/2)/c*arctan((
2*c*x+b)/(4*a*c-b^2)^(1/2))*a*b*e+4/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*d+1/(4*a*c-b^2)^(3
/2)/c^2*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b^3*e

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.4298, size = 1736, normalized size = 13.15 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

[1/2*((4*a^2*c^2*d + (4*a*c^3*d + (b^3*c - 6*a*b*c^2)*e)*x^2 + (a*b^3 - 6*a^2*b*c)*e + (4*a*b*c^2*d + (b^4 - 6
*a*b^2*c)*e)*x)*sqrt(b^2 - 4*a*c)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x
^2 + b*x + a)) - 2*(a*b^3*c - 4*a^2*b*c^2)*d + 2*(a*b^4 - 6*a^2*b^2*c + 8*a^3*c^2)*e - 2*((b^4*c - 6*a*b^2*c^2
 + 8*a^2*c^3)*d - (b^5 - 7*a*b^3*c + 12*a^2*b*c^2)*e)*x + ((b^4*c - 8*a*b^2*c^2 + 16*a^2*c^3)*e*x^2 + (b^5 - 8
*a*b^3*c + 16*a^2*b*c^2)*e*x + (a*b^4 - 8*a^2*b^2*c + 16*a^3*c^2)*e)*log(c*x^2 + b*x + a))/(a*b^4*c^2 - 8*a^2*
b^2*c^3 + 16*a^3*c^4 + (b^4*c^3 - 8*a*b^2*c^4 + 16*a^2*c^5)*x^2 + (b^5*c^2 - 8*a*b^3*c^3 + 16*a^2*b*c^4)*x), 1
/2*(2*(4*a^2*c^2*d + (4*a*c^3*d + (b^3*c - 6*a*b*c^2)*e)*x^2 + (a*b^3 - 6*a^2*b*c)*e + (4*a*b*c^2*d + (b^4 - 6
*a*b^2*c)*e)*x)*sqrt(-b^2 + 4*a*c)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - 2*(a*b^3*c - 4*a^2*
b*c^2)*d + 2*(a*b^4 - 6*a^2*b^2*c + 8*a^3*c^2)*e - 2*((b^4*c - 6*a*b^2*c^2 + 8*a^2*c^3)*d - (b^5 - 7*a*b^3*c +
 12*a^2*b*c^2)*e)*x + ((b^4*c - 8*a*b^2*c^2 + 16*a^2*c^3)*e*x^2 + (b^5 - 8*a*b^3*c + 16*a^2*b*c^2)*e*x + (a*b^
4 - 8*a^2*b^2*c + 16*a^3*c^2)*e)*log(c*x^2 + b*x + a))/(a*b^4*c^2 - 8*a^2*b^2*c^3 + 16*a^3*c^4 + (b^4*c^3 - 8*
a*b^2*c^4 + 16*a^2*c^5)*x^2 + (b^5*c^2 - 8*a*b^3*c^3 + 16*a^2*b*c^4)*x)]

________________________________________________________________________________________

Sympy [B]  time = 3.02967, size = 901, normalized size = 6.83 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(e*x+d)/(c*x**2+b*x+a)**2,x)

[Out]

(e/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*
c**2 + 12*a*b**4*c - b**6)))*log(x + (-16*a**2*c**3*(e/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e - 4*a*c*
*2*d - b**3*e)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + 8*a**2*c*e + 8*a*b**2*c**2*
(e/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*
c**2 + 12*a*b**4*c - b**6))) - a*b**2*e - 2*a*b*c*d - b**4*c*(e/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e
 - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))))/(6*a*b*c*e - 4*a*c*
*2*d - b**3*e)) + (e/(2*c**2) + sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c*
*3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6)))*log(x + (-16*a**2*c**3*(e/(2*c**2) + sqrt(-(4*a*c - b**2)**3)*(
6*a*b*c*e - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + 8*a**2*c*
e + 8*a*b**2*c**2*(e/(2*c**2) + sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c*
*3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) - a*b**2*e - 2*a*b*c*d - b**4*c*(e/(2*c**2) + sqrt(-(4*a*c - b*
*2)**3)*(6*a*b*c*e - 4*a*c**2*d - b**3*e)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))))/(
6*a*b*c*e - 4*a*c**2*d - b**3*e)) + (2*a**2*c*e - a*b**2*e + a*b*c*d + x*(3*a*b*c*e - 2*a*c**2*d - b**3*e + b*
*2*c*d))/(4*a**2*c**3 - a*b**2*c**2 + x**2*(4*a*c**4 - b**2*c**3) + x*(4*a*b*c**3 - b**3*c**2))

________________________________________________________________________________________

Giac [A]  time = 1.32245, size = 228, normalized size = 1.73 \begin{align*} -\frac{{\left (4 \, a c^{2} d + b^{3} e - 6 \, a b c e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt{-b^{2} + 4 \, a c}} + \frac{e \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} - \frac{a b c d - a b^{2} e + 2 \, a^{2} c e +{\left (b^{2} c d - 2 \, a c^{2} d - b^{3} e + 3 \, a b c e\right )} x}{{\left (c x^{2} + b x + a\right )}{\left (b^{2} - 4 \, a c\right )} c^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(e*x+d)/(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

-(4*a*c^2*d + b^3*e - 6*a*b*c*e)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/((b^2*c^2 - 4*a*c^3)*sqrt(-b^2 + 4*a*c
)) + 1/2*e*log(c*x^2 + b*x + a)/c^2 - (a*b*c*d - a*b^2*e + 2*a^2*c*e + (b^2*c*d - 2*a*c^2*d - b^3*e + 3*a*b*c*
e)*x)/((c*x^2 + b*x + a)*(b^2 - 4*a*c)*c^2)